<?php
    require('config.php');
    $_mysqli = new mysqli($db_hosts, $db_user, $db_pwd, $db_name);
    $check_sql = "select * from user";
    $result = $_mysqli->query($check_sql);
    if (!$result){
    $create_t1 = 'CREATE TABLE article(id SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT, userid SMALLINT(3) , title VARCHAR(40), content TEXT(6000) , lable VARCHAR(40) , times DATETIME,PRIMARY KEY(id))';
    $create_t2 = 'CREATE TABLE user(id SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT, username VARCHAR(10), userpasswd VARCHAR(16) , times DATETIME,PRIMARY KEY(id))';
    $create_t3 = 'CREATE TABLE comment(pid SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT, zid SMALLINT(4), pcontent TEXT(1000) , pname VARCHAR(40) , pmail VARCHAR(40) , times DATETIME,PRIMARY KEY(pid))';
    $_mysqli ->set_charset("utf8");
    $_mysqli ->query($create_t1);
    $_mysqli ->query($create_t2);
    $_mysqli ->query($create_t3);
    }